export default {
    methods: {
        resizeHandler() {
            if (this.chart) {
                setTimeout(() => {
                    this.chart.resize();
                }, 100);
            }
            if (this.chartDept) {
                setTimeout(() => {
                    this.chartDept.resize();
                }, 100);
            }
        },
        destroyResizeEvent() {
            window.removeEventListener('resize', this.resizeHandler)
        },
    },
    mounted() {
        window.addEventListener('resize', this.resizeHandler);
    },
    deactivated() {
        this.destroyResizeEvent();
    },
    beforeDestroy() {
        this.destroyResizeEvent();
    },
}